﻿using Autofac;
using Service.Inferface;
using Service.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Service.Config;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var builder = new ContainerBuilder();
            ServiceConfig.Buider.InitIoc(builder);

            // Set the dependency resolver to be Autofac.
            var container = builder.Build();
            IMenuService menuService = container.Resolve<IMenuService>();
            Menu menu = new Menu()
            {
                Name = "菜单管理",
                Url = "/api/menu"
            };
            Console.WriteLine(menuService.Add(menu));
            Console.WriteLine("按任意键退出");
            Console.ReadKey();
        }
    }
}
